<template>
  <n-modal
    preset="card"
    :show="show"
    title="编辑"
    :on-after-enter="onAfterEnter"
    :on-after-leave="onAfterLeave"
    @close="handleClose"
  >
    <!-- :style="'width: ' + (width || '60%')" -->

    <slot></slot>
    <template #footer>
      <n-space justify="end">
        <slot name="footer"></slot>
      </n-space>
    </template>
  </n-modal>
</template>
<script lang="ts" setup>
defineProps({
  show: {
    type: Boolean
  },
  width: {}
})

const emit = defineEmits(['close', 'afterEnter', 'afterLeave'])

const handleClose = () => {
  emit('close')
}

const onAfterEnter = () => {
  emit('afterEnter')
}

const onAfterLeave = () => {
  emit('afterLeave')
}
</script>
